<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8" />
		<title>面向研究团队的参考文献管理与服务分布式系统</title>
		<meta name="keywords" content="面向研究团队的参考文献管理与服务分布式系统" />
		<meta name="description" content="面向研究团队的参考文献管理与服务分布式系统" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<link href="../css/bootstrap.min.css" rel="stylesheet" />
		<link href="../css/bootstrap-table.css" rel="stylesheet" />
		<link href="../css/bootstrap-editable.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/font-awesome.min.css" />

		<link rel="stylesheet" href="../css/ace.min.css" />
		<link rel="stylesheet" href="../css/ace-rtl.min.css" />
		<link rel="stylesheet" href="../css/ace-skins.min.css" />

		<script src="../js/ace-extra.min.js"></script>
		<script src="../js/angular.min.js"></script>
		<script src="../js/angular-cookies.min.js"></script>

	</head>

	<body>

		<div class="navbar navbar-default" id="navbar">
			<script type="text/javascript">
				try {
					ace.settings.check('navbar', 'fixed')
				} catch(e) {}
			</script>
			<div class="navbar-container" id="navbar-container">
				<div class="navbar-header pull-left">
					<a href="#" class="navbar-brand">
						<small>
							<i class="icon-book"></i>
						
							面向研究团队的参考文献管理与服务分布式系统
						</small>
					</a>
					<!-- /.brand -->
				</div>
				<!-- /.navbar-header -->

				<div class="navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">

						<li class="light-blue">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<img class="nav-user-photo" src="../avatars/user.jpg" alt="Jason's Photo" />
								<span class="user-info">
									<small>欢迎,</small>
									登录
								</span>

								<i class="icon-caret-down"></i>
							</a>

							<ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li>
									<a href="#">
										<i class="icon-cog"></i> 设置
									</a>
								</li>

								<li>
									<a href="#">
										<i class="icon-user"></i> 简况
									</a>
								</li>

								<li class="divider"></li>

								<li>
									<a href="/ma/user/logout"  class="a_post">
										<i class="icon-off"></i> 登出
									</a>
								</li>
							</ul>
						</li>
					</ul>
					<!-- /.ace-nav -->
				</div>
				<!-- /.navbar-header -->
			</div>
			<!-- /.container -->

		</div>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try {
					ace.settings.check('main-container', 'fixed')
				} catch(e) {}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<div class="sidebar" id="sidebar">
					<script type="text/javascript">
						try {
							ace.settings.check('sidebar', 'fixed')
						} catch(e) {}
					</script>

					<!-- #sidebar-shortcuts -->
					<ul class="nav nav-list">
						
						
						
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-book"></i>
								<span class="menu-text"> 所有参考文献 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu">
								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-double-angle-right"></i>
										图书
										<b class="arrow icon-angle-down"></b>
									</a>
									<ul class="submenu">
										<li>
											<a href="Chinesebooks.html">
												<i class="icon-leaf"></i>
												中文图书
											</a>
											
										</li>
										<li>
											<a href="Englishjournals.html">
												<i class="icon-leaf"></i>
												西文图书
											</a>
											
										</li>
										
									</ul>
								</li>

								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-double-angle-right"></i>
										期刊
										<b class="arrow icon-angle-down"></b>
									</a>
									<ul class="submenu">
										<li>
											<a href="/ma/goToChineseJournalsPage">
												<i class="icon-leaf"></i>
												中文期刊
											</a>
										</li>
										<li>
											<a href="/ma/goToEnglishJournalsPage">
												<i class="icon-leaf"></i>
												西文期刊
											</a>
										</li>
										
									</ul>
								</li>


								

								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-double-angle-right"></i>
										学位论文
										<b class="arrow icon-angle-down"></b>
									</a>
									
									<ul class="submenu">
										<li>
											<a href="#">
												<i class="icon-leaf"></i>
												中文学位论文
											</a>
											
										</li>
										<li>
											<a href="#">
												<i class="icon-leaf"></i>
												西文学位论文
											</a>
											
										</li>
										
									</ul>
										
								</li>

								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-double-angle-right"></i>

										技术报告
										<b class="arrow icon-angle-down"></b>
									</a>

									<ul class="submenu">
										<li>
											<a href="#">
												<i class="icon-leaf"></i>
												中文技术报告
											</a>
										</li>

										<li>
											<a href="#" class="dropdown-toggle">
												<i class="icon-leaf"></i>

												西文技术报告
												
											</a>

										
										</li>
									</ul>
								</li>
								
								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-double-angle-right"></i>
										专利
										<b class="arrow icon-angle-down"></b>
									</a>
									<ul class="submenu">
										<li>
											<a href="#">
												<i class="icon-leaf"></i>
												中文专利
											</a>
											
										</li>
										<li>
											<a href="#">
												<i class="icon-leaf"></i>
												西文专利
											</a>
											
										</li>
										
									</ul>
								</li>
							</ul>
						</li>
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-book"></i>
								<span class="menu-text"> 期刊论文集 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu">
								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-double-angle-right"></i>
										期刊
										<b class="arrow icon-angle-down"></b>
									</a>
									<ul class="submenu">
										<li class="active">
											<a href="/ma/miuser/journalAdd.html">
												<i class="icon-leaf"></i>
												中文期刊
											</a>											
										</li>
										<li>
											<a href="/ma/miuser/journalAdd1.html">
												<i class="icon-leaf"></i>
												西文期刊
											</a>
											
										</li>
										
									</ul>
								</li>
								
									<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-double-angle-right"></i>
										论文集
										<b class="arrow icon-angle-down"></b>
									</a>
									<ul class="submenu">
										<li>
											<a href="#">
												<i class="icon-leaf"></i>
												中文论文集
											</a>
											
										</li>
										<li>
											<a href="#">
												<i class="icon-leaf"></i>
												西文论文集
											</a>
											
										</li>
										
									</ul>
								</li>
								</ul>
								</li>	
						<li>
							<a href="referenceGroup.html">
								<i class="icon-dashboard"></i>
								<span class="menu-text"> 参考文献分组 </span>
							</a>
						</li>
						<li>
							<a href="/ma/miuser/sync.html">
								<i class="icon-bolt"></i>
								<span class="menu-text"> 数据同步 </span>
							</a>
						</li>
						<li>
							<a href="email2.html">
								<i class="glyphicon glyphicon-envelope"></i>
								<span class="menu-text"> Email系统 </span>
							</a>
						</li>
						<li>
							<a href="message2.html">
								<i class="glyphicon glyphicon-comment"></i>
								<span class="menu-text"> 短信系统 </span>
							</a>
						</li>
						<li>
						<li>
							<a href="#">
								<i class="glyphicon glyphicon-user"></i>
								<span class="menu-text"> 个人信息 </span>
							</a>
						</li>
						<li>
							<a href="javascript:modify()">
								<i class="glyphicon glyphicon-user"></i>
								<span class="menu-text"> 修改密码 </span>
							</a>
						</li>
						<li>
							<a href="index.html">
								<i class="glyphicon glyphicon-off"></i>
								<span class="menu-text"> 退出系统 </span>
							</a>
						</li>
						
					</ul>
					<!-- /.nav-list -->

					<div class="sidebar-collapse" id="sidebar-collapse">
						<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
					</div>

					<script type="text/javascript">
						try {
							ace.settings.check('sidebar', 'collapsed')
						} catch(e) {}
					</script>
				</div>

				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try {
								ace.settings.check('breadcrumbs', 'fixed')
							} catch(e) {}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="#">主页</a>
							</li>
						</ul>
						<!-- .breadcrumb -->

						<!-- #nav-search -->
					</div>

					<div class="page-content">
						<h1>这是美丽的主页</h1>
						<h2>这是美丽的主页</h2>
						<h3>这是美丽的主页</h3>
						<h4>这是美丽的主页</h4>
						<h5>这是美丽的主页</h5>
						<h6>这是美丽的主页</h6>
					</div>
				<!-- /.main-content -->

				<div class="ace-settings-container" id="ace-settings-container">
					<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
						<i class="icon-cog bigger-150"></i>
					</div>

					<div class="ace-settings-box" id="ace-settings-box">
						<div>
							<div class="pull-left">
								<select id="skin-colorpicker" class="hide">
									<option data-skin="default" value="#438EB9">#438EB9</option>
									<option data-skin="skin-1" value="#222A2D">#222A2D</option>
									<option data-skin="skin-2" value="#C6487E">#C6487E</option>
									<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
									</select>
							</div>
							<span>&nbsp; 换肤</span>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
							<label class="lbl" for="ace-settings-add-container">
								居中
								<b></b>
							</label>
						</div>
					</div>
				</div>
				<!-- /#ace-settings-container -->
			</div>
			<!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>

		</div>
		<div id="myModal" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
			<div class="modal-dialog " role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title">修改密码</h4>
					</div>
					<div class="modal-body">
						<div class="row">
							<div class="col-sm-3">旧密码：</div>
							<div class="col-sm-6"><input type="password" id="oldpsw"></input></div>
						</div>
						<div class="row">
							<div class="col-sm-3">新密码：</div>
							<div class="col-sm-6"><input type="password" id="newpsw"></input></div>
						</div>
						<div class="row">
							<div class="col-sm-3">再次输入新密码：</div>
							<div class="col-sm-6"><input type="password" id="newpsw1"></input></div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" onclick="modifypsw()" class="btn btn-default confirm">确定</button>
					</div>
				</div>
			</div>
		</div>
        </div>
		
		

		<script src="../js/jquery-2.0.3.min.js"></script>
		<script src="../js/jquery.cookie.js"></script>

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='../js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
		</script>
		<script src="../js/bootstrap.min.js"></script>
		<script src="../js/bootstrap-table.js"></script>
		<script src="../js/bootstrap-editable.js"></script>
		<script src="../js/bootstrap-table-zh-CN.js"></script>
		<script src="../js/typeahead-bs2.min.js"></script>

		<script src="../js/ace-elements.min.js"></script>
		<script src="../js/ace.min.js"></script>
		<script type="text/javascript">
		
		function modifypsw(){
			var oldpsw = $('#oldpsw').val();
			var newpsw = $('#newpsw').val();
			var newpsw1 = $('#newpsw1').val();
			var userNo = $.cookie("userNo");
			var psw = $.cookie("psw");
			if(!(newpsw===newpsw1))
				alert("两次密码不相同");
			else if(oldpsw===psw)
			{
				$.ajax({
					type : "Post",//'","password":"' + password +
					contentType : "application/json",
					data : '{"userNo":"' + userNo+'","role":"b","password":"' + newpsw +   '"}',
					dataType : 'json',
					url : '/ma/user/modify',
					success : function(data) {
						alert("密码修改成功！"); //提醒用户保存修改信息成功
					},
					error : function() {
						alert("保存失败！"); //提醒用户保存修改信息失败
					}
				});
			}else
			{
				alert("旧密码错误");
			}
		}
		function modify(){
			$('#myModal').modal();
        }
        var teamno;
			var app = angular.module('myApp', []);
		app.controller('myCtrl', function($scope, $http) {//将用户的个人信息在文本框中显示出来
			//var userNo='<%=Session["userInfo"]%>'; // session.getAttribute("userInfo").userNo
			//var user={$scope};
			//console.log(userNo)
			
			$http({
				method : 'POST',
				data : 'json',
				url : '/ma/user/getUserAndTeam'
			}).then(function successCallback(response) {
				console.log(response.data)
				var user = response.data;
				
				$scope.userNo = user.userNo;
				$scope.userName = user.userName;
				teamno = user.userTeamNo;
				$scope.iDNo = user.iDNo;
				$scope.userPhone = user.userPhone;
				$scope.userEmail = user.userEmail;
				$scope.userRole = user.userRole;
				$scope.userRoleName = user.userRoleName;
				$scope.note = user.note;
			}, function errorCallback(response) { // 请求失败执行代码
				alert("无法读取个人信息！");
			});
		});
	
		$('#submit').click(function(e) { //点击编辑按钮后实现个人信息保存功能
			var note = $("#note").val();
			var userNo = $("#userNo").val();
			var userName = $("#userName").val();
			var iDNo = $("#iDNo").val();
			var userPhone = $("#userPhone").val();
			var userEmail = $("#userEmail").val();
/*			var category = $("#category").val();
			var major = $("#discipline").val();
			alert(category+"-"+major);
			if(check(iDNo)||check(userEmail)||check(userPhone)||check(userName)||check(category)||check(major))
            	alert("请完善信息");
            else
            {
            	$.ajax({
            		type : "Post",//'","password":"' + password +
            		contentType : "application/json",
            		data : '{"userNo":"' + userNo + '","userTeamNo":"' + userTeamNo + '","discipline":"' + major +'","note":"' + note + '","userName":"' + userName +'","iDNo":"' + iDNo +'","role":"b","userPhone":"' + userPhone +  '","category":"' + category + '","userEmail":"' + userEmail + '"}',
            		dataType : 'json',
            		url : '/ma/user/update',
            		success : function(data) {
            			alert("保存成功！"); //提醒用户保存修改信息成功
            		},
            		error : function() {
            			alert("保存失败！"); //提醒用户保存修改信息失败
            		}
            	});
            }*/
            $.ajax({
                type : "Post",
                contentType : "application/json",
                //data : '{"userNo":"' + userNo + '","userTeamNo":"' + userTeamNo + '","discipline":"' + major +'","note":"' + note + '","userName":"' + userName +'","iDNo":"' + iDNo +'","role":"b","userPhone":"' + userPhone +  '","category":"' + category + '","userEmail":"' + userEmail + '"}',
                data:JSON.stringify({
                    "userNo": userNo,
                    "userName" : userName,
                    "iDNo": iDNo,
                    "userPhone" : userPhone,
                    "userEmail" : userEmail,
                    "note": note
                }),
                dataType : 'json',
                url : '/ma/user/update',
                success : function(data) {
                    alert("保存成功！"); //提醒用户保存修改信息成功
                },
                error : function() {
                    alert("保存失败！"); //提醒用户保存修改信息失败
                }
            });
			
		});
		function check(t)
		{
			//alert(t);
			if(t==="" || t==null)
				return true;
			else
				return false;
		}
		//初始化学科门类
		function categoryinit(){
			 $.ajax({  
	             type: 'get',  
	             url: "./category/query",  
	             dataType: 'json',  
	             async: false,  
	             success: function (Data) {	
	            	 var optionstring="";
	            	 for (var i in Data) {  		            		
	                     var jsonObj =Data[i]["categoryName"];   
	                      optionstring += "<option value=\"" +jsonObj+ "\" >" + jsonObj + "</option>";             
	                 } 
	            	   $("#category").html("<option value='请选择'>请选择...</option> "+optionstring); 
	             },  
	             error: function (XMLHttpRequest, textStatus, errorThrown) {//请求失败处理函数  
	                 console.log("请求失败，无法获取分组数据");  
	             }  
	         }); 				
		}
	//门类发生变化	
	function categoryChange(){
		var selected = document.getElementById("category").value;
		 $.ajax({  
             type: 'get',  
             url: "./category/query/"+selected,  
             dataType: 'json',  
             async: false,  
             success: function (Data) {	
            	 var optionstring="";
            	 for (var i in Data) {  		            		
                     var jsonObj =Data[i]["major"];   
                      optionstring += "<option value=\"" +jsonObj+ "\" >" + jsonObj + "</option>";             
                 } 
            	   $("#discipline").html("<option value='请选择'>请选择...</option> "+optionstring); 
             },  
             error: function (XMLHttpRequest, textStatus, errorThrown) {//请求失败处理函数  
                 console.log("请求失败，无法获取分组数据");  
             }  
         }); 
	}
		</script>
	</body>

</html>